<template>
	<div>
	<h2>这个是用来存放pinia的子组件</h2>	
	{{store.uservalue}}
	</div>
	<button @click="change">修改</button>
</template>

<script setup>
	name:'children1'
	import {user} from '@/store/user.js'
	import {storeToRefs} from 'pinia'
	const store=new user()
	// let {uservalue}=storeToRefs(store)
	function change(){
		store.$patch(state=>{
			//用于批量修改
			state.uservalue='uservalue被子组件所修改了'
		})
	}
</script>

<style>
</style>